package com.atguigu.classes.OOPSeven;

/**
 * @program: IDEAcode
 * @description:
 * @author: Mr.zjx
 * create: 2021-07-18-20-55
 **/
public class Test {
    public static void main(String[] args) {
        Person person = getPerson();
        System.out.println(person.name);

        Animal animal = getAnimal();
        animal.eat();
    }

    public static Animal getAnimal(){
        return new Cat();
    }

    public static Person getPerson(){
        return new Person();
    }
}
